<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="/management/css/css.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/dwr/util.js"></script>
		<script type="text/javascript" src="/js/common/commanFunction.js"></script>
		<title>用户管理</title>
		<script type="text/javascript">
			function finduser(){
					document.getElementById("userform").action="/management/user/findusermanager.do";
	    	    	document.getElementById("userform").submit();
	    	    	return false;
			}
		</script>
	</head>
	<body>
		<form action="" name="userform" id="userform" method="post">
			<table width="90%" align="center" style="border:solid 1px #000000"
				bgcolor="#3366FF" cellpadding="1" cellspacing="1">
				<tr bgcolor="#FFFFFF">
					<td align="center" colspan="5" class="title">
						用户管理&nbsp;&nbsp;
							<a href="/management/user/getuser.do">添加用户</a>
						&nbsp;
					</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td align="left" colspan="5">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查询角色
						<select id="roleid" name="roleid" onchange="return finduser();">
							<option value="0">
								请选择
							</option>
						</select>
					</td>
				</tr>
				<s:if test="${userlist ne null }">
					<tr bgcolor="#FFFFFF">
						<td align="center" width="20%" class="boldfont">
							用户名称
						</td>
						<td align="center" width="20%" class="boldfont">
							用户密码
						</td>
						<td align="center" width="20%" class="boldfont">
							用户姓名
						</td>
						<td align="center" width="20%" class="boldfont">
							操作
						</td>
					</tr>
					<s:iterator id="userlst" value="userlist">
						<tr bgcolor="#FFFFFF">
							<td align="center">
								${userlst.username }
							</td>
							<td align="center">
								${userlst.password }
							</td>
							<td align="center">
								${userlst.xingming }
							</td>
							<td align="center">
									<a
										href="/management/user/getuser.do?id=${userlst.id }"
										name="ac">修改</a>
								&nbsp;|&nbsp;
									<a
										href="/management/user/deleteuser.do?id=${userlst.id }&roleid=${userlst.syRoleinfo.id }">删除</a>
							</td>
						</tr>
					</s:iterator>
				</s:if>
			</table>
		</form>
	<script type="text/javascript" src="/js/common/dialog.js"></script>
	<script type="text/javascript">
  		window.onload=new function(){
  			  var msg = "${message}";
	     	  if(msg != ""){
	     	  	if(msg==1){
		     	  	msg="操作成功";
				}else if(msg==2){
					msg="操作失败";
				}
	    	    showMessage(msg);
	          }
  		}
  	</script>
	</body>
</html>
